package com.connector.server.server;

import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
import io.netty.buffer.Unpooled;
import java.util.List;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;

public class ByteArrayToBinaryEncoder extends MessageToMessageEncoder<byte[]>
{
    protected void encode(final ChannelHandlerContext ctx, final byte[] msg, final List<Object> out) throws Exception {
        out.add(new BinaryWebSocketFrame(Unpooled.wrappedBuffer(msg)));
    }
}
